package impl

import (
	"github.com/infraboard/mcube/ioc"
	"github.com/infraboard/mcube/ioc/config/mongo"
	mongo_driver "go.mongodb.org/mongo-driver/mongo"
)

func init() {
	ioc.Controller().Registry(&HelloServiceImpl{})
}

// 业务逻辑实现类
type HelloServiceImpl struct {
	db *mongo_driver.Database
	// db *gorm.DB
	ioc.ObjectImpl
}

// 控制器初始化
func (i *HelloServiceImpl) Init() error {
	i.db = mongo.DB()
	// i.db = conf.C().MySQL.GetConn().Debug()
	return nil
}

// 具体业务逻辑
func (i *HelloServiceImpl) Hello() string {
	return "hello world"
}
